<template>
  <view :style="themeColor">
    <view class="page">
      <view class="flex align-stretch benben-position-layout flex searchResult_flex_0"
        :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
        <view class='flex align-center justify-between flex-sub searchResult_fd0_0'>
          <view class='flex align-center searchResult_fd0_0_c0' @tap.stop="handleJumpDiy" data-type="back" data-url="1">
            <text class='fu-iconfont2  searchResult_fd0_0_c0_c0'>&#xE794;</text>
          </view>
          <view class='flex align-center flex-sub searchResult_fd0_0_c1'>
            <text class='fu-iconfont2  searchResult_fd0_0_c1_c0'>&#xe77e;</text>
            <input class='flex-sub searchResult_fd0_0_c1_c1' type="text" :placeholder="$t('搜索小区或商圈')"
              confirm-type="done" :maxlength="-1" placeholder-style="color:rgba(191, 191, 191, 1);font-size:28rpx"
              v-model="keyworld" @confirm="getList()"/>
            <image class='searchResult_fd0_0_c1_c2' mode="aspectFit" :src='STATIC_URL+"35.png"'
              @tap.stop="clearnInputFunc()" v-if=" keyworld!=''"></image>
          </view>
          <!-- <view class='flex flex-direction flex-wrap align-center searchResult_fd0_0_c2' @tap.stop="handleJumpDiy"
            data-type="navigateTo" :data-url="`/pages/map/mapone`">
            <image class='searchResult_fd0_0_c2_c0' mode="aspectFit" :src='STATIC_URL+"34.png"'></image>
            <text class='searchResult_fd0_0_c2_c1'>{{$t('地图')}}</text>
          </view> -->
        </view>

      </view>
      <view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
      <view class="flex benben-position-layout flex flex-wrap align-center searchResult_flex_1"
        :style="{top:(88+StatusBarRpx)+'rpx', }">
        <view>
          <benben-flex-tabs class-name='searchResult_benbenTabsfd1_0' v-model="tabls" ref="benben_tabsfd1_0"
            select-mark="benben_tabsfd1_0" key="benben_tabsfd1_0" :open-title-type='false' :open-sticky='true' :top='0'
            :is-show-content='false' :scrollspy='false' :tabs-info.sync="tabsInfofd1_0" @change="getList()">

            <scroll-view @scroll="tabsInfofd1_0.scrollX = $event.detail.scrollLeft" id="benben_tabsfd1_0"
              class="benben-tabs" style="width:750rpx" :scroll-x="true" :scroll-left.sync="tabsInfofd1_0.moveX"
              scroll-with-animation="all .3s ease">
              <view class="benben-tabs-content" id="benben_tabsfd1_0-content">
                <view id="benben_tabsfd1_0-title" class="benben-tabs-title flex align-center flex ">
                  <view
                    :class="{ 'checkTitlefd1_0': tabls == '1', 'flex flex-wrap align-center searchResult_titlefd1_0_c3': true }"
                    @tap="tabls = '1'" :id="`benben_tabsfd1_0-title-item-${'1'}`">

                    <text class='searchResult_titleItemfd1_0_c3_c0'>{{$t('个人房源')}}</text>

                  </view>
                  <view
                    :class="{ 'checkTitlefd1_0': tabls == '3', 'flex flex-wrap align-center searchResult_titlefd1_0_c3': true }"
                    @tap="tabls = '3'" :id="`benben_tabsfd1_0-title-item-${'3'}`">

                    <text class='searchResult_titleItemfd1_0_c3_c0'>{{$t('中介房源')}}</text>

                  </view>
                  <view
                    :class="{ 'checkTitlefd1_0': tabls == '4', 'flex flex-wrap align-center searchResult_titlefd1_0_c3': true }"
                    @tap="tabls = '4'" :id="`benben_tabsfd1_0-title-item-${'4'}`">

                    <text class='searchResult_titleItemfd1_0_c3_c0'>{{$t('品牌公寓')}}</text>

                  </view>
                </view>
                <view :style="{ left: tabsInfofd1_0.lineleft, maxWidth: tabsInfofd1_0.lineWidth ,}"
                  id="benben_tabsfd1_0-line" class="benben-tabs-line flex benben-flex-tabs-line searchResult_linefd1_0">
                </view>
              </view>
            </scroll-view>

          </benben-flex-tabs>

        </view>

      </view>
      <view :style="{height: '88rpx'}"></view>
      <!---flex布局flex布局开始-->
      <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout searchResult_flex_2"
        v-if=" in_array(tabls,'1,3')">
        <view class='flex flex-wrap align-center searchResult_fd2_0' @tap.stop="handleJumpDiy" data-type="navigateTo"
          :data-url="`/pages/shouye/propertyDetails/propertyDetails?id=${item.aid}`" v-for="(item,index) in houseList" :key="index">
          <view class='flex flex-direction flex-wrap align-start searchResult_fd2_0_c0'>
            <image class='searchResult_fd2_0_c0_c0' mode="aspectFill" :src="item.images[0] || '/static/logo.png'"></image>
            <text class='searchResult_fd2_0_c0_c1' :class="item.rental_method!=1 ? 'active' : ''">{{item.rental_method_name}}</text>
          </view>
          <view class='flex flex-direction flex-wrap align-start flex-sub'>
            <view class='flex flex-wrap align-center'>
              <text class='searchResult_fd2_0_c1_c0_c0'>{{item.name}}</text>
            </view>
            <view class='flex flex-wrap align-center searchResult_fd2_0_c1_c1'>
              <text class='searchResult_fd2_0_c1_c1_c0'>{{item.housingtype_name}}</text>
              <text class='searchResult_fd2_0_c1_c1_c0'>{{item.housinglift_name}}</text>
              <text class='searchResult_fd2_0_c1_c1_c0'>{{item.housingtenantgender_name}}</text>
              <text class='searchResult_fd2_0_c1_c1_c0'>{{item.area}}</text>
            </view>
            <view class='flex flex-wrap align-center searchResult_fd2_0_c1_c1'>
              <image class='searchResult_fd2_0_c1_c2_c0' mode="aspectFit" :src='STATIC_URL+"32.png"'></image>
              <text class='searchResult_fd2_0_c1_c2_c1'>{{item.housingaddress_name}}</text>
            </view>
            <view class='flex flex-wrap align-center searchResult_fd2_0_c1_c3'>
              <text class='searchResult_fd2_0_c1_c3_c0'>{{$t('HK$')}}</text>
              <text class='searchResult_fd2_0_c1_c3_c1'>{{item.monthly_rent}}</text>
              <text class='searchResult_fd2_0_c1_c3_c0'>/{{$t('月')}}</text>
            </view>
          </view>
        </view>
      </view>

      <!---flex布局flex布局结束-->
      <!---flex布局flex布局开始-->
      <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout searchResult_flex_3"
        v-if=" tabls=='4'">
        <view class='flex flex-wrap align-center searchResult_fd3_0' @tap.stop="handleJumpDiy" data-type="navigateTo"
          :data-url="`/pages/shouye/apartmentDetails/apartmentDetails?id=${item.aid}`" v-for="(item,index) in houseList" :key="index">
          <view class='flex flex-direction flex-wrap align-start searchResult_fd3_0_c0'>
            <image class='searchResult_fd3_0_c0_c0' mode="aspectFit" :src="item.images[0] || '/static/logo.png'"></image>
          </view>
          <view class='flex flex-direction flex-wrap align-stretch flex-sub'>
            <view class='flex flex-wrap align-center'>
              <text class='searchResult_fd3_0_c1_c0_c0'>{{item.apartmentbrand_name}}</text>
              <text class='searchResult_fd3_0_c1_c0_c1'>{{item.name}}</text>
            </view>
            <view class='flex flex-wrap align-center searchResult_fd3_0_c1_c1'>
              <image class='searchResult_fd3_0_c1_c1_c0' mode="aspectFit" :src='STATIC_URL+"32.png"'></image>
              <text class='searchResult_fd3_0_c1_c1_c1'>{{item.housingmrt_name}}</text>
            </view>
            <view class='flex flex-direction flex-wrap align-stretch searchResult_fd3_0_c1_c2'>
              <view class='flex flex-wrap align-center justify-between' v-for="(itemC,indexC) in item.house_list">
                <text class='searchResult_fd3_0_c1_c2_c0_c0'>{{itemC.name}}</text>
                <view class='flex flex-wrap align-center'>
                  <text class='searchResult_fd3_0_c1_c2_c0_c1_c0'>{{$t('HK$')}}</text>
                  <text class='searchResult_fd3_0_c1_c2_c0_c1_c1'>{{itemC.price}}</text>
                  <text class='searchResult_fd3_0_c1_c2_c0_c1_c0'>/{{$t('月')}}</text>
                </view>
              </view>
            </view>
          </view>
        </view>
      </view>
      <fu-empty-ui v-if="houseList.length==0"></fu-empty-ui>
      <!---flex布局flex布局结束-->


    </view>
  </view>
</template>
<script>
  import pagingList from '@/common/mixin/paging_list.js';
  export default {
    components: {},
    mixins: [pagingList],

    data() {
      return {
        "tabsInfofd1_0": {
          lineleft: '',
          lineWidth: '',
          moveX: 0,
          scrollX: 0,
          PageScrollX: 0
        },
        "tabls": "1",
        "keyworld": "",
        "type": "1",
        "minixPagingListsApi": "",
        "pageingListApiMethod": "",
        "allowOnloadGetList": false,
        "houseList": [],
      };
    },
    computed: {
      themeColor() {
        return this.$store.getters.themeColor
      },

    },
    watch: {},
    onLoad(options) {
      let {
        keyworld,
        type
      } = options
      if (keyworld !== undefined) this.keyworld = keyworld
      if (type !== undefined) this.type = type
      this.getList()
    },
    onUnload() {

    },
    onReady() {

    },
    onShow() {

    },
    onHide() {

    },
    onResize() {

    },
    onPullDownRefresh() {

    },
    onReachBottom(e) {

    },
    onPageScroll(e) {

    },
    methods: {
      getList() {
        this.minixPagingListsApi = global.apiUrls.post65433985092d4;
        this.pageingListApiMethod = 'post';
        this.allowOnloadGetList = false;
        this.pagingListPostDataContent = {
          keywords: this.keyworld,
          publisher_type: this.tabls,
        }
        this.listData = [];
        this.houseList = this.listData;
        this.pagingListToggle();
      },
      pagingListPostData() {
        return this.pagingListPostDataContent
      },
      //清除搜索框
      clearnInputFunc() {
        this.keyworld = '';
      }
    }
  };
</script>
<style lang="scss" scoped>
  .page {
    width: 100vw;
    overflow-x: hidden;
    min-height: calc(100vh - var(--window-bottom));
    background: rgba(248, 248, 248, 1);
    background-size: 100% auto;
  }

  .searchResult_flex_0 {
    background: #fff;
    width: 750rpx;
    height: 88rpx;
    overflow: hidden;
    z-index: 10;
    top: 0rpx;
    background-size: 100% auto !important;
  }

  .searchResult_fd0_0_c2_c1 {
    color: #333333;
    font-size: 22rpx;
    font-weight: 500;
    line-height: 32rpx;
  }

  .searchResult_fd0_0_c2_c0 {
    width: 40rpx;
    height: 40rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
  }

  .searchResult_fd0_0_c2 {
    margin: 0rpx 0rpx 0rpx 34rpx;
  }

  .searchResult_fd0_0_c1_c2 {
    width: 32rpx;
    height: 32rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
  }

  .searchResult_fd0_0_c1_c1 {
    font-size: 28rpx;
    font-weight: 400;
    color: #333;
    height: 20rpx;
  }

  .searchResult_fd0_0_c1_c0 {
    font-size: 30rpx;
    color: rgba(153, 153, 153, 1);
    margin: 0rpx 8rpx 0rpx 0rpx;
  }

  .searchResult_fd0_0_c1 {
    background: #F9F9F9;
    height: 64rpx;
    border-radius: 34rpx 34rpx 34rpx 34rpx;
    padding: 0rpx 24rpx 0rpx 24rpx;
  }

  .searchResult_fd0_0_c0_c0 {
    font-size: 36rpx;
    font-weight: 500;
    color: #333;
  }

  .searchResult_fd0_0_c0 {
    margin: 0rpx 50rpx 0rpx 0rpx;
  }

  .searchResult_fd0_0 {
    padding: 0rpx 26rpx 0rpx 35rpx;
  }

  .searchResult_flex_1 {
    background: rgba(255, 255, 255, 1);
    width: 750rpx;
    height: 88rpx;
    overflow: hidden;
    z-index: 10;
    top: 88rpx;
    background-size: 100% auto;
  }

  .searchResult_titleItemfd1_0_c3_c0 {
    padding: 12rpx 18rpx 12rpx 18rpx;
    line-height: 28rpx;
    border-radius: 28rpx;
  }

  .searchResult_titlefd1_0_c3 {
    border-radius: 28rpx;
    margin: 0rpx 24rpx 0rpx 0rpx;
  }

  .searchResult_linefd1_0 {
    background: rgba(255, 255, 255, 1);
    width: 100rpx;
    height: 8rpx;
    top: 80rpx;
    background-size: 100% auto !important;
  }

  .checkTitlefd1_0 {
    font-weight: 500 !important;
    font-size: 24rpx !important;
    color: rgba(1, 129, 255, 1) !important;
    background-color: rgba(1, 129, 255, 0.1) !important;
  }

  ::v-deep .searchResult_benbenTabsfd1_0 {
    background: #fff;
    width: 750rpx;
    height: 104rpx;
    white-space: nowrap;
    text-align: center;
    padding: 0rpx 0rpx 0rpx 32rpx;
    font-size: 24rpx;
    font-weight: 400;
    color: #333333;
  }

  .searchResult_flex_2 {
    padding: 24rpx 24rpx 0rpx 24rpx;
  }

  .searchResult_fd2_1_c0_c1 {
    background: rgba(250, 164, 58, 0.8);
    padding: 6rpx 14rpx 6rpx 14rpx;
    border-radius: 16rpx 0rpx 16rpx 0rpx;
    background-size: 100% auto;
    color: #FFFFFF;
    font-size: 24rpx;
    font-weight: 500;
    line-height: 24rpx;
    position: absolute;
    top: 0rpx;
    left: 0rpx;
  }

  .searchResult_fd2_0_c1_c3_c1 {
    color: #F7582F;
    font-size: 36rpx;
    font-weight: 700;
    line-height: 36rpx;
  }

  .searchResult_fd2_0_c1_c3_c0 {
    color: #F7582F;
    font-size: 24rpx;
    font-weight: 700;
    line-height: 32rpx;
  }

  .searchResult_fd2_0_c1_c3 {
    margin: 13rpx 0rpx 0rpx 0rpx;
  }

  .searchResult_fd2_0_c1_c2_c1 {
    color: #666666;
    font-size: 24rpx;
    font-weight: 400;
    line-height: 32rpx;
  }

  .searchResult_fd2_0_c1_c2_c0 {
    width: 24rpx;
    height: 24rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
    margin: 0rpx 4rpx 0rpx 0rpx;
  }

  .searchResult_fd2_0_c1_c1_c0 {
    background: rgba(243, 245, 250, 1);
    color: rgba(106, 124, 143, 1);
    font-size: 22rpx;
    font-weight: 400;
    line-height: 32rpx;
    padding: 0rpx 7rpx 0rpx 7rpx;
    background-size: 100% auto !important;
    margin: 0rpx 10rpx 0rpx 0rpx;
  }

  .searchResult_fd2_0_c1_c1 {
    margin: 8rpx 0rpx 0rpx 0rpx;
  }

  .searchResult_fd2_0_c1_c0_c0 {
    color: #333333;
    font-size: 32rpx;
    font-weight: 500;
    line-height: 42rpx;
    -webkit-line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
  }

  .searchResult_fd2_0_c0_c1 {
    background: rgba(52, 122, 255, 0.8);
    padding: 6rpx 14rpx 6rpx 14rpx;
    border-radius: 16rpx 0rpx 16rpx 0rpx;
    background-size: 100% auto;
    color: #FFFFFF;
    font-size: 24rpx;
    font-weight: 500;
    line-height: 24rpx;
    position: absolute;
    top: 0rpx;
    left: 0rpx;
    &.active{
      background: rgba(250, 164, 58, 0.8);
    }
  }

  .searchResult_fd2_0_c0_c0 {
    width: 226rpx;
    height: 226rpx;
    border-radius: 16rpx;
  }

  .searchResult_fd2_0_c0 {
    position: relative;
    margin: 0rpx 24rpx 0rpx 0rpx;
  }

  .searchResult_fd2_0 {
    background: rgba(255, 255, 255, 1);
    border-radius: 16rpx;
    background-size: 100% auto !important;
    margin: 0rpx 0rpx 24rpx 0rpx;
    padding: 24rpx;
  }

  .searchResult_flex_3 {
    padding: 24rpx 24rpx 0rpx 24rpx;
  }

  .searchResult_fd3_0_c1_c2_c1 {
    margin: 20rpx 0rpx 0rpx 0rpx;
  }

  .searchResult_fd3_0_c1_c2_c0_c1_c1 {
    color: #F7582F;
    font-size: 36rpx;
    font-weight: 700;
    line-height: 36rpx;
  }

  .searchResult_fd3_0_c1_c2_c0_c1_c0 {
    color: #F7582F;
    font-size: 24rpx;
    font-weight: 700;
    line-height: 32rpx;
  }

  .searchResult_fd3_0_c1_c2_c0_c0 {
    color: #333333;
    font-size: 28rpx;
    font-weight: 500;
    line-height: 32rpx;
  }

  .searchResult_fd3_0_c1_c2 {
    margin: 27rpx 0rpx 0rpx 0rpx;
  }

  .searchResult_fd3_0_c1_c1_c1 {
    color: #666666;
    font-size: 24rpx;
    font-weight: 400;
    line-height: 32rpx;
  }

  .searchResult_fd3_0_c1_c1_c0 {
    width: 24rpx;
    height: 24rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
    margin: 0rpx 4rpx 0rpx 0rpx;
  }

  .searchResult_fd3_0_c1_c1 {
    margin: 8rpx 0rpx 0rpx 0rpx;
  }

  .searchResult_fd3_0_c1_c0_c1 {
    color: #333333;
    font-size: 32rpx;
    font-weight: 500;
    line-height: 42rpx;
    -webkit-line-clamp: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    width: 245rpx;
  }

  .searchResult_fd3_0_c1_c0_c0 {
    background: linear-gradient(134deg, #FF9402 0%, #FFCE00 100%);
    padding: 6rpx 4rpx 6rpx 4rpx;
    background-size: 100% auto;
    color: #FFFFFF;
    font-size: 24rpx;
    font-weight: 500;
    // line-height: 24rpx;
    border-radius: 4rpx;
    -webkit-line-clamp: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    width: 106rpx;
    margin: 0rpx 9rpx 0rpx 0rpx;
  }

  .searchResult_fd3_0_c0_c0 {
    width: 226rpx;
    height: 226rpx;
    border-radius: 16rpx;
  }

  .searchResult_fd3_0_c0 {
    position: relative;
    margin: 0rpx 24rpx 0rpx 0rpx;
  }

  .searchResult_fd3_0 {
    background: rgba(255, 255, 255, 1);
    border-radius: 16rpx;
    background-size: 100% auto !important;
    margin: 0rpx 0rpx 24rpx 0rpx;
    padding: 24rpx;
  }
</style>
